import QtQuick 1.0

Item {
	id: ratingBar
	height: ratingRow.height

	opacity: 0.0

	property int rating: 0

	Row {
		id: ratingRow
		width: parent.width
		height: 20
		spacing: 5
		Text {
			id: ratingTitle
			height: parent.height
			anchors.verticalCenter: parent.verticalCenter
			text: "Rating:  "
			color: "white"
			font.pixelSize: 14
			font.bold: true
		}

		Repeater {
			id: star_on
			model: rating

			Image {
				width: 10  //20
				height: 10

				source: "pics/star_on.gif"
			}
		}

		Repeater {
			id: star_off
			model: 10 - rating

			Image {
				width: 10
				height: 10

				source: "pics/star_off.gif"
			}
		}
	}
	states: State {
		name: "Show"
		//when: rating >= 0
		PropertyChanges {
			target: ratingBar
			opacity: 1.0
		}
	}

	Behavior on opacity {PropertyAnimation{duration: 300}}
}
